import { getRouter } from "src/router"

const goTo = (url: string) => {
  sessionStorage.setItem('openlink_tag', `1`);
  sessionStorage.setItem('openlink_back_path', getRouter().currentRoute.value.path);
  getRouter().push({path: '/openlink', query: { url: encodeURIComponent(url)}})
}

export  const useOpenLink = () => {
  return {
    goTo
  }
}
